home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-12-04 | 3.6 KB | 77 lines | [TEXT/SPM ] |
-
- UDP Probe
-
- Mac Application to send UDP datagrams and to look for responses.
-
- This is loosely based on code by Olaf Titz (udpprobe) which does the same
- thing but on the unix side of things.
-
- I needed a small application to test my TCP library, and this just
- happened to fit the bill. It is especially nice because it will
- test the udp side of the library (very little sample code exists
- for working with udp connections).
-
- Hope you like it...
-
- Dave Nebinger
- dnebing@epix.net
-
- P.S.
- UDP Probe originally started out using just UDP for probing the host. However, I also wanted
- to check the TCP side of my MacTCP library, so I decided to add TCP probing facilities to the
- UDP Probe application.
-
- So I started adding the TCP code, basically using a cut-n-paste approach from the UDP code
- and replacing UDP with TCP. Everything looked good until I tried to execute the application.
- For some reason, I couldn't receive any replies because I would get the message that the
- host had closed the connection.
-
- Meanwhile, that would really confuse my application and crash it, leaving the open TCP stream
- out there to wreak havoc on my mac as soon as I tried to open a new application. So I went
- back to the TCP library and added logic from DTS's ZapTCP so the library could clean itself
- up when it crashed. That saved me alot of resets...
-
- Anyway, to make a long debugging story short, after a day of wanting to rip out my hair I realized
- that in copying UDP code and replacing it with TCP code, I had kept the code to send data to the
- host. I finally realized that the host daemons didn't know why I would be sending them information,
- especially since they were just supposed to send information (I was testing using the DayTime
- daemon), so they would close the connection and leave me hanging. The moral of the story is
- that not all TCP daemons work like UDP daemons.
-
- In the end it works like this: you must know what kind of daemon you are probing. If it is something
- like the DayTime daemon, you should clear all of the information from the 'Send:' portion of the
- Probe dialog. If you are probing a daemon like the Echo daemon, then you should put something
- in there.
-
- Dave.
-
- [Original README follows below...]
-
- udpprobe - send a UDP datagram and look for response, version 1.1
-
- This program sends a UDP datagram to a specified port and optionally
- waits for response. It is intended mainly for testing and signaling
- purposes. You can use it on the echo or daytime port (cf.
- /etc/services and /etc/inetd.conf) to test if your network is alive
- and the UDP modules of specific hosts are working. You can also use it
- for signaling: configure inetd to start a specific program whenever it
- receives a packet on a special port. This way you can configure a
- system with a mail server and clients that are not always running, so
- that the mailer is told from a client by sending a UDP packet (i.e.
- an "I am here" message) to deliver mail, and similar things.
-
- I have written this program on Linux 0.99.14 and tested it on Ultrix
- 4.3 and HPUX 8.07 as well. It should run on any system that has
- reasonably BSD-compatible networking and getopts(3) (not really needed
- but I'm lazy :-). Perhaps you need to tune the header includes a
- bit. You don't need special privileges to compile or run this program.
-
- Note: If you're looking for a similar (but much more powerful) tool to
- access TCP ports, try socket(1) from the comp.sources.unix archive.
-
- Written by Olaf Titz <olaf@bigred.ka.sub.org>
- This software is released into the public domain. The author assumes
- no responsibility of any kind for its use.
-
-
-